<template>
  <div class="crisis-intervention">
    <div class="container">
      <div class="navbar">
        <div class="nav-back" @click="$router.go(-1)">
          <i class="fas fa-chevron-left"></i>
        </div>
        <div class="nav-title">危机干预知识库</div>
        <div></div>
      </div>
      <main>
        <div class="modules-grid">
          <!-- 心理风险探测板块 -->
          <div class="module-card" @click="opentance()">
            <div class="card-icon">
              <i class="fas fa-search"></i>
            </div>
            <h2 class="card-title">心理风险探测</h2>
            <p class="card-description">
              判断识别员工潜在的心理健康风险，建立预防性干预能力。
            </p>
          </div>

          <!-- 心理风险响应板块 -->
          <div class="module-card" @click="openxiangying()">
            <div class="card-icon">
              <i class="fas fa-first-aid"></i>
            </div>
            <h2 class="card-title">心理风险响应</h2>
            <p class="card-description">
              了解心理风险场景及响应策略，为面临心理危机的员工提供及时、有效的支持。
            </p>
          </div>

          <!-- 组织士气与动力恢复板块 -->
          <div class="module-card" @click="openzuzhi">
            <div class="card-icon">
              <i class="fas fa-users"></i>
            </div>
            <h2 class="card-title">组织士气与动力恢复</h2>
            <p class="card-description">
              帮助团队在危机后重建信任、恢复士气，提升组织凝聚力和员工工作动力。
            </p>
          </div>
        </div>
      </main>
    </div>
  </div>
</template>

<script>
export default {
  name: "CrisisIntervention",
  methods: {
    navigateTo(module) {
      // 这里可以添加路由导航逻辑
      console.log(`导航到模块: ${module}`);
      // 例如: this.$router.push(`/${module}`);
    },
    opentance() {
      // 这里可以根据实际路由配置进行调整
      this.$router.push("/manager/zhishiku/fengxiantance");
      // this.showMessageFunc(
      //   "已选择: 自杀尝试类",
      //   this.getColorByCategory("自杀尝试类")
      // );
    },
    openxiangying() {
      // 这里可以根据实际路由配置进行调整
      this.$router.push("/manager/zhishiku/fengxianxiangying");
      // this.showMessageFunc(
      //   "已选择: 自杀尝试类",
      //   this.getColorByCategory("自杀尝试类")
      // );
    },
    openzuzhi() {
      // 这里可以根据实际路由配置进行调整
      this.$router.push("/manager/zhishiku/zuzhi");
      // this.showMessageFunc(
      //   "已选择: 自杀尝试类",
      //   this.getColorByCategory("自杀尝试类")
      // );
    },
  },
};
</script>

<style scoped>
/* 基础样式 */

.navbar {
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 15px;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: fixed;
}

.nav-back {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.nav-back:hover {
  background: #e0e0e0;
}

.nav-title {
  color: #333;
  font-size: 18px;
  font-weight: 600;
}
.crisis-intervention {
  background: linear-gradient(135deg, #f0f4f8 0%, #d9e2ec 100%);
  color: #333;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
  margin: 0;
  width: 100%;
  overflow-x: hidden;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin-top: 50px;
  padding: 20px;
  box-sizing: border-box;
}

header {
  text-align: center;
  margin-bottom: 40px;
  padding: 20px 0;
  width: 100%;
}

h1 {
  font-size: 1.8rem;
  color: #2c5aa0;
  margin-bottom: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
  line-height: 1.3;
}

.subtitle {
  font-size: 1rem;
  color: #5a7fbb;
  max-width: 100%;
  margin: 0 auto;
  line-height: 1.4;
}

.modules-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

.module-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  padding: 25px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
}

.module-card:active {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.card-icon {
  font-size: 2.5rem;
  margin-bottom: 20px;
  color: #2c5aa0;
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #f0f4f8;
  box-shadow: 0 3px 8px rgba(44, 90, 160, 0.2);
  flex-shrink: 0;
}

.card-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: #2c5aa0;
  margin-bottom: 12px;
  line-height: 1.3;
  width: 100%;
}

.card-description {
  color: #555;
  font-size: 0.95rem;
  line-height: 1.6;
  width: 100%;
  text-align: left;
}

/* 平板适配 - 768px以上 */
@media (min-width: 768px) {
  .crisis-intervention {
    padding: 20px;
    justify-content: center;
    box-sizing: border-box;
  }

  .container {
    padding: 30px;
  }

  header {
    margin-bottom: 50px;
  }

  h1 {
    font-size: 2.2rem;
    margin-bottom: 15px;
  }

  .subtitle {
    font-size: 1.1rem;
    max-width: 600px;
  }

  .modules-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
  }

  .module-card {
    padding: 30px 25px;
  }

  .card-icon {
    width: 80px;
    height: 80px;
    font-size: 3rem;
    margin-bottom: 25px;
  }

  .card-title {
    font-size: 1.5rem;
  }

  .card-description {
    font-size: 1.05rem;
    text-align: center;
  }
}

/* PC适配 - 1024px以上 */
@media (min-width: 1024px) {
  .modules-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
  }

  h1 {
    font-size: 2.8rem;
  }

  .subtitle {
    font-size: 1.2rem;
  }

  .module-card {
    padding: 30px;
  }

  .module-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
  }

  .card-icon {
    width: 100px;
    height: 100px;
    font-size: 3.5rem;
  }

  .card-title {
    font-size: 1.6rem;
  }
}

/* 超小屏手机适配 - 360px以下 */
@media (max-width: 360px) {
  .container {
    padding: 15px;
  }

  header {
    margin-bottom: 30px;
    padding: 10px 0;
  }

  h1 {
    font-size: 1.6rem;
  }

  .subtitle {
    font-size: 0.9rem;
  }

  .modules-grid {
    gap: 15px;
  }

  .module-card {
    padding: 20px 15px;
  }

  .card-icon {
    width: 60px;
    height: 60px;
    font-size: 2.2rem;
    margin-bottom: 15px;
  }

  .card-title {
    font-size: 1.2rem;
  }

  .card-description {
    font-size: 0.9rem;
  }
}

/* 防止内容溢出 */
.module-card {
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

/* 确保在移动端有良好的触摸体验 */
@media (max-width: 767px) {
  .module-card {
    -webkit-tap-highlight-color: transparent;
  }
}
</style>
